/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: Faculty of informatics, Burapha University 01
 * License Type: Purchased
 */
package cn.imvc.app.entities;

import java.io.Serializable;
import javax.persistence.*;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="member")
public class Member implements Serializable {
	public Member() {
	}
	
	private int id;
	
	private cn.imvc.app.entities.Member parent;
	
	private String loginname;
	
	private String passwd;
	
	private String key1;
	
	private String key2;
	
	private String name;
	
	private String truename;
	
	private String avatar;
	
	private Byte sex;
	
	private java.util.Date birthday;
	
	private String email;
	
	private Byte emailBind;
	
	private String mobile;
	
	private String qq;
	
	private String weixin;
	
	private String wxOpenid;
	
	private String qqOpenid;
	
	private Byte state;
	
	private java.sql.Timestamp time;
	
	private String guid;
	
	private String unionid;
	
	private String app;
	
	private java.util.Set goodsOrder = new java.util.HashSet();
	
	private java.util.Set storageOrder = new java.util.HashSet();
	
	private java.util.Set orders = new java.util.HashSet();
	
	private java.util.Set fundFlow = new java.util.HashSet();
	
	private java.util.Set dealerApply = new java.util.HashSet();
	
	private cn.imvc.app.entities.Dealer dealer;
	
	private cn.imvc.app.entities.Account account;
	
	private java.util.Set cart = new java.util.HashSet();
	
	private java.util.Set address = new java.util.HashSet();
	
	private java.util.Set favorites = new java.util.HashSet();
	
	private java.util.Set commission = new java.util.HashSet();
	
	private java.util.Set appInviter = new java.util.HashSet();
	
	private java.util.Set member = new java.util.HashSet();
	
	private java.util.Set comments = new java.util.HashSet();
	
	private java.util.Set bankcard = new java.util.HashSet();
	
	private java.util.Set withdrawals = new java.util.HashSet();
	
	private java.util.Set commission1 = new java.util.HashSet();
	
	private java.util.Set salesReturn = new java.util.HashSet();
	
	private java.util.Set fundFlow1 = new java.util.HashSet();
	
	private java.util.Set voucher = new java.util.HashSet();
	
	private java.util.Set memberRed = new java.util.HashSet();
	
	public void setId(int value) {
		this.id = value;
	}
	
	@Column(name="id", nullable=false)	
	@Id	
	@GeneratedValue(generator="CN_IMVC_APP_ENTITIES_MEMBER_ID_GENERATOR")	
	@org.hibernate.annotations.GenericGenerator(name="CN_IMVC_APP_ENTITIES_MEMBER_ID_GENERATOR", strategy="identity")	
	public int getId() {
		return id;
	}
	
	@Transient	
	public int getORMID() {
		return getId();
	}
	
	/**
	 * 登录名
	 */
	public void setLoginname(String value) {
		this.loginname = value;
	}
	
	/**
	 * 登录名
	 */
	@Column(name="loginname", nullable=true, length=255)	
	public String getLoginname() {
		return loginname;
	}
	
	/**
	 * 密码
	 */
	public void setPasswd(String value) {
		this.passwd = value;
	}
	
	/**
	 * 密码
	 */
	@Column(name="passwd", nullable=true, length=255)	
	public String getPasswd() {
		return passwd;
	}
	
	/**
	 * 密码加密
	 */
	public void setKey1(String value) {
		this.key1 = value;
	}
	
	/**
	 * 密码加密
	 */
	@Column(name="key1", nullable=true, length=255)	
	public String getKey1() {
		return key1;
	}
	
	/**
	 * 会员名称或昵称
	 */
	public void setName(String value) {
		this.name = value;
	}
	
	/**
	 * 会员名称或昵称
	 */
	@Column(name="name", nullable=true, length=255)	
	public String getName() {
		return name;
	}
	
	/**
	 * 真实姓名
	 */
	public void setTruename(String value) {
		this.truename = value;
	}
	
	/**
	 * 真实姓名
	 */
	@Column(name="truename", nullable=true, length=255)	
	public String getTruename() {
		return truename;
	}
	
	/**
	 * 头像
	 */
	public void setAvatar(String value) {
		this.avatar = value;
	}
	
	/**
	 * 头像
	 */
	@Column(name="avatar", nullable=true, length=255)	
	public String getAvatar() {
		return avatar;
	}
	
	/**
	 * 性别
	 */
	public void setSex(byte value) {
		setSex(new Byte(value));
	}
	
	/**
	 * 性别
	 */
	public void setSex(Byte value) {
		this.sex = value;
	}
	
	/**
	 * 性别
	 */
	@Column(name="sex", nullable=true)	
	public Byte getSex() {
		return sex;
	}
	
	/**
	 * 生日
	 */
	public void setBirthday(java.util.Date value) {
		this.birthday = value;
	}
	
	/**
	 * 生日
	 */
	@Column(name="birthday", nullable=true)	
	@Temporal(TemporalType.TIMESTAMP)	
	public java.util.Date getBirthday() {
		return birthday;
	}
	
	/**
	 * 邮箱
	 */
	public void setEmail(String value) {
		this.email = value;
	}
	
	/**
	 * 邮箱
	 */
	@Column(name="email", nullable=true, length=255)	
	public String getEmail() {
		return email;
	}
	
	/**
	 * 0未绑定1已绑定
	 */
	public void setEmailBind(byte value) {
		setEmailBind(new Byte(value));
	}
	
	/**
	 * 0未绑定1已绑定
	 */
	public void setEmailBind(Byte value) {
		this.emailBind = value;
	}
	
	/**
	 * 0未绑定1已绑定
	 */
	@Column(name="emailBind", nullable=true)	
	public Byte getEmailBind() {
		return emailBind;
	}
	
	/**
	 * 手机号
	 */
	public void setMobile(String value) {
		this.mobile = value;
	}
	
	/**
	 * 手机号
	 */
	@Column(name="mobile", nullable=true, length=255)	
	public String getMobile() {
		return mobile;
	}
	
	/**
	 * qq号
	 */
	public void setQq(String value) {
		this.qq = value;
	}
	
	/**
	 * qq号
	 */
	@Column(name="qq", nullable=true, length=255)	
	public String getQq() {
		return qq;
	}
	
	/**
	 * 微信号
	 */
	public void setWeixin(String value) {
		this.weixin = value;
	}
	
	/**
	 * 微信号
	 */
	@Column(name="weixin", nullable=true, length=255)	
	public String getWeixin() {
		return weixin;
	}
	
	/**
	 * 微信用户统一标识
	 */
	public void setWxOpenid(String value) {
		this.wxOpenid = value;
	}
	
	/**
	 * 微信用户统一标识
	 */
	@Column(name="wxOpenid", nullable=true, length=255)	
	public String getWxOpenid() {
		return wxOpenid;
	}
	
	/**
	 * qqid
	 */
	public void setQqOpenid(String value) {
		this.qqOpenid = value;
	}
	
	/**
	 * qqid
	 */
	@Column(name="qqOpenid", nullable=true, length=255)	
	public String getQqOpenid() {
		return qqOpenid;
	}
	
	/**
	 * 状态 1为开启 0为关闭
	 */
	public void setState(byte value) {
		setState(new Byte(value));
	}
	
	/**
	 * 状态 1为开启 0为关闭
	 */
	public void setState(Byte value) {
		this.state = value;
	}
	
	/**
	 * 状态 1为开启 0为关闭
	 */
	@Column(name="state", nullable=true)	
	public Byte getState() {
		return state;
	}
	
	/**
	 * 注册时间unix时间戳
	 */
	public void setTime(java.sql.Timestamp value) {
		this.time = value;
	}
	
	/**
	 * 注册时间unix时间戳
	 */
	@Column(name="time", nullable=true)	
	public java.sql.Timestamp getTime() {
		return time;
	}
	
	public void setGuid(String value) {
		this.guid = value;
	}
	
	@Column(name="guid", nullable=true, length=1000)	
	public String getGuid() {
		return guid;
	}
	
	public void setKey2(String value) {
		this.key2 = value;
	}
	
	@Column(name="key2", nullable=true, length=255)	
	public String getKey2() {
		return key2;
	}
	
	public void setUnionid(String value) {
		this.unionid = value;
	}
	
	@Column(name="unionid", nullable=true, length=255)	
	public String getUnionid() {
		return unionid;
	}
	
	public void setApp(String value) {
		this.app = value;
	}
	
	@Column(name="app", nullable=true, length=255)	
	public String getApp() {
		return app;
	}
	
	public void setParent(cn.imvc.app.entities.Member value) {
		this.parent = value;
	}
	
	@ManyToOne(targetEntity=cn.imvc.app.entities.Member.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="parentId", referencedColumnName="id", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Member getParent() {
		return parent;
	}
	
	public void setGoodsOrder(java.util.Set value) {
		this.goodsOrder = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.GoodsOrder.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getGoodsOrder() {
		return goodsOrder;
	}
	
	
	public void setStorageOrder(java.util.Set value) {
		this.storageOrder = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.StorageOrder.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getStorageOrder() {
		return storageOrder;
	}
	
	
	public void setOrders(java.util.Set value) {
		this.orders = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.Orders.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getOrders() {
		return orders;
	}
	
	
	public void setFundFlow(java.util.Set value) {
		this.fundFlow = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.FundFlow.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getFundFlow() {
		return fundFlow;
	}
	
	
	public void setDealerApply(java.util.Set value) {
		this.dealerApply = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.DealerApply.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getDealerApply() {
		return dealerApply;
	}
	
	
	public void setDealer(cn.imvc.app.entities.Dealer value) {
		this.dealer = value;
	}
	
	@OneToOne(mappedBy="member", targetEntity=cn.imvc.app.entities.Dealer.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Dealer getDealer() {
		return dealer;
	}
	
	public void setAccount(cn.imvc.app.entities.Account value) {
		this.account = value;
	}
	
	@OneToOne(mappedBy="member", targetEntity=cn.imvc.app.entities.Account.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	public cn.imvc.app.entities.Account getAccount() {
		return account;
	}
	
	public void setCart(java.util.Set value) {
		this.cart = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.Cart.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getCart() {
		return cart;
	}
	
	
	public void setAddress(java.util.Set value) {
		this.address = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.Address.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getAddress() {
		return address;
	}
	
	
	public void setFavorites(java.util.Set value) {
		this.favorites = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.Favorites.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getFavorites() {
		return favorites;
	}
	
	
	public void setCommission(java.util.Set value) {
		this.commission = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.Commission.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getCommission() {
		return commission;
	}
	
	
	public void setAppInviter(java.util.Set value) {
		this.appInviter = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.AppInviter.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getAppInviter() {
		return appInviter;
	}
	
	
	public void setMember(java.util.Set value) {
		this.member = value;
	}
	
	@OneToMany(mappedBy="parent", targetEntity=cn.imvc.app.entities.Member.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getMember() {
		return member;
	}
	
	
	public void setComments(java.util.Set value) {
		this.comments = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.Comments.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getComments() {
		return comments;
	}
	
	
	public void setBankcard(java.util.Set value) {
		this.bankcard = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.Bankcard.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@OrderBy(value="isDefault desc")	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getBankcard() {
		return bankcard;
	}
	
	
	public void setWithdrawals(java.util.Set value) {
		this.withdrawals = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.Withdrawals.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getWithdrawals() {
		return withdrawals;
	}
	
	
	public void setCommission1(java.util.Set value) {
		this.commission1 = value;
	}
	
	@OneToMany(mappedBy="fromMember", targetEntity=cn.imvc.app.entities.Commission.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getCommission1() {
		return commission1;
	}
	
	
	public void setSalesReturn(java.util.Set value) {
		this.salesReturn = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.SalesReturn.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getSalesReturn() {
		return salesReturn;
	}
	
	
	public void setFundFlow1(java.util.Set value) {
		this.fundFlow1 = value;
	}
	
	@OneToMany(mappedBy="fromMember", targetEntity=cn.imvc.app.entities.FundFlow.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getFundFlow1() {
		return fundFlow1;
	}
	
	
	public void setVoucher(java.util.Set value) {
		this.voucher = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.Voucher.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getVoucher() {
		return voucher;
	}
	
	
	public void setMemberRed(java.util.Set value) {
		this.memberRed = value;
	}
	
	@OneToMany(mappedBy="member", targetEntity=cn.imvc.app.entities.MemberRed.class)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.TRUE)	
	public java.util.Set getMemberRed() {
		return memberRed;
	}
	
	
	public String toString() {
		return toString(false);
	}
	
	public String toString(boolean idOnly) {
		if (idOnly) {
			return String.valueOf(getId());
		}
		else {
			StringBuffer sb = new StringBuffer();
			sb.append("Member[ ");
			sb.append("Id=").append(getId()).append(" ");
			if (getParent() != null)
				sb.append("Parent.Persist_ID=").append(getParent().toString(true)).append(" ");
			else
				sb.append("Parent=null ");
			sb.append("Loginname=").append(getLoginname()).append(" ");
			sb.append("Passwd=").append(getPasswd()).append(" ");
			sb.append("Key1=").append(getKey1()).append(" ");
			sb.append("Key2=").append(getKey2()).append(" ");
			sb.append("Name=").append(getName()).append(" ");
			sb.append("Truename=").append(getTruename()).append(" ");
			sb.append("Avatar=").append(getAvatar()).append(" ");
			sb.append("Sex=").append(getSex()).append(" ");
			sb.append("Birthday=").append(getBirthday()).append(" ");
			sb.append("Email=").append(getEmail()).append(" ");
			sb.append("EmailBind=").append(getEmailBind()).append(" ");
			sb.append("Mobile=").append(getMobile()).append(" ");
			sb.append("Qq=").append(getQq()).append(" ");
			sb.append("Weixin=").append(getWeixin()).append(" ");
			sb.append("WxOpenid=").append(getWxOpenid()).append(" ");
			sb.append("QqOpenid=").append(getQqOpenid()).append(" ");
			sb.append("State=").append(getState()).append(" ");
			sb.append("Time=").append(getTime()).append(" ");
			sb.append("Guid=").append(getGuid()).append(" ");
			sb.append("Unionid=").append(getUnionid()).append(" ");
			sb.append("App=").append(getApp()).append(" ");
			sb.append("GoodsOrder.size=").append(getGoodsOrder().size()).append(" ");
			sb.append("StorageOrder.size=").append(getStorageOrder().size()).append(" ");
			sb.append("Orders.size=").append(getOrders().size()).append(" ");
			sb.append("FundFlow.size=").append(getFundFlow().size()).append(" ");
			sb.append("DealerApply.size=").append(getDealerApply().size()).append(" ");
			if (getDealer() != null)
				sb.append("Dealer.Persist_ID=").append(getDealer().toString(true)).append(" ");
			else
				sb.append("Dealer=null ");
			if (getAccount() != null)
				sb.append("Account.Persist_ID=").append(getAccount().toString(true)).append(" ");
			else
				sb.append("Account=null ");
			sb.append("Cart.size=").append(getCart().size()).append(" ");
			sb.append("Address.size=").append(getAddress().size()).append(" ");
			sb.append("Favorites.size=").append(getFavorites().size()).append(" ");
			sb.append("Commission.size=").append(getCommission().size()).append(" ");
			sb.append("AppInviter.size=").append(getAppInviter().size()).append(" ");
			sb.append("Member.size=").append(getMember().size()).append(" ");
			sb.append("Comments.size=").append(getComments().size()).append(" ");
			sb.append("Bankcard.size=").append(getBankcard().size()).append(" ");
			sb.append("Withdrawals.size=").append(getWithdrawals().size()).append(" ");
			sb.append("Commission1.size=").append(getCommission1().size()).append(" ");
			sb.append("SalesReturn.size=").append(getSalesReturn().size()).append(" ");
			sb.append("FundFlow1.size=").append(getFundFlow1().size()).append(" ");
			sb.append("Voucher.size=").append(getVoucher().size()).append(" ");
			sb.append("MemberRed.size=").append(getMemberRed().size()).append(" ");
			sb.append("]");
			return sb.toString();
		}
	}
	
}
